Lattice based traffic measurement at a switch in a communication network

ABSTRACT

A lattice of interconnected concepts is constructed from flow entries. Each concept describes a subset of flows and a subset of the flow attributes. Based on user queries, the lattice is used to build disjoint sets of flows referred to as flowsets. Each user query specifies one or more of the flow attributes to be measured. Each flowset includes one or more of the flows to thereby enable sharing of the hardware counters among the flows. One hardware counter is then assigned to each flowset.

TECHNICAL FIELD

Embodiments of the invention relate generally to communication networks. More particularly, embodiments of the invention relate to network traffic measurement.

BACKGROUND

Network traffic measurement allows network managers to monitor network activities and to plan for network operations. Tools for measuring traffic need to scale with a wide spectrum of applications, flows and queries while maintaining the performance of the underlying hardware in terms of accuracy and speed. Conventional solutions sample traffic and send per-flow statistics to a remote server that serves user applications. Measuring per-flow traffic often results in inaccuracy and sending per-flow statistics often results in intensive resource and network bandwidth usage.

Conventional flow-based measurement techniques generally use a large number of managed hardware counters due to a direct correlation between the number of counters and the flow table size. Further, conventional techniques typically gather per-flow statistics continually in dataplane without consideration of application needs. It is up to user applications to pull desired flow counters. This disconnection between user applications and traffic measurement induces a large number of transactions, excessive bandwidth usage and may affect packet processing performances.

For example, Cisco Netflow is a data monitoring and collection system. In a Netflow-capable switch or router, flow statistics are tracked at the datapath continuously at a specific sampling rate. Statistics of each flow are sent to a Netflow Data Collector which serves user applications. The Netflow-capable switch creates a number of transactions with a bandwidth usage proportional to the number of flows regardless of the actual need of the applications.

A recent approach to reducing the number of hardware counters was proposed in ProgME: towards programmable network measurement, IEEE/ACM Transactions on Networking, February 2011, vol. 19, No. 1. The architecture proposed there is based on analyzing individual packets contents with a binary decision diagram (BDD), and finding out an optimal allocation of flows using a Disentangling algorithm. However, there is no evidence of convergence or optimality for the Disentangling algorithm especially with large flow descriptors such as in the context of OpenFlow capable switches.

SUMMARY

According to one embodiment of the invention, a method is provided for assigning hardware counters to flows that pass through a switch in a communication network for performing measurement at the switch. Each of the flows is associated with a set of flow attributes. A lattice of interconnected concepts is constructed by a processor from flow entries available at the switch, each concept describing a subset of the flows and a subset of the flow attributes. A set of user queries is received by the processor, where each user query specifies one or more of the flow attributes to be measured. Based on the user queries, the processor identifies disjoint flowsets from the lattice. At least one of the flowsets includes more than one of the flows to enable sharing of the hardware counters among the flows belonging to the same flowset. One hardware counter is then assigned to each flowset.

According to another embodiment of the invention, a computing device in a communication network is provided to assign hardware counters to flows that pass through a switch for performing measurement at the switch. Each of the flows is associated with a set of flow attributes. The computing device includes input circuitry adapted to receive flow entries available at the switch and a set of user queries, where each user query specifies one or more of the flow attributes to be measured. The computing device also includes a processor. The processor further includes a concept generator module adapted to construct a lattice of interconnected concepts from the flow entries, each concept describing a subset of the flows and a subset of the flow attributes; a flowset builder module adapted to identify disjoint flowsets from the lattice based on the set of user queries, at least one of the flowsets comprising more than one of the flows to enable sharing of the hardware counters among the flows belonging to the same flowset; and a counter placement module adapted to assign one hardware counter to each flowset. The computing device further includes output circuitry to output a mapping between flow identifiers and hardware counter identifiers to the switch for assignment of the hardware counters.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments are illustrated by way of example and not by way of limitation in the figures of the accompanying drawings, in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one.

FIG. 1 illustrates an example of hardware counter assignment with flow aggregation.

FIG. 2 illustrates an example of a lattice.

FIG. 3 illustrates an example of an input context according to one embodiment of the invention.

FIG. 4 illustrates an example of a concept lattice for the input context of FIG. 3 according to one embodiment of the invention.

FIG. 5 illustrates an example of an extended input context according to one embodiment of the invention.

FIG. 6 illustrates an example of a concept lattice for the extended input context of FIG. 5 according to one embodiment of the invention.

FIG. 7 illustrates a computing device that performs counter assignment according to one embodiment of the invention.

FIG. 8 is a flow diagram illustrating a method for assigning hardware counters according to one embodiment of the invention.

FIG. 9 is a flow diagram illustrating a method for building flowsets according to one embodiment of the invention.

DETAILED DESCRIPTION

In the following description, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known circuits, structures and techniques have not been shown in detail in order not to obscure the understanding of this description. It will be appreciated, however, by one skilled in the art, that the invention may be practiced without such specific details. Those of ordinary skill in the art, with the included descriptions, will be able to implement appropriate functionality without undue experimentation.

Embodiments of the invention provide a framework based on the lattice theory for improving the scalability and performance of flow-based measurements. This lattice-based framework is referred to as the FlowME framework. The framework minimizes the number of hardware counters that need to be maintained, and reduces device-to-users transactions and bandwidth required for achieving accurate traffic measurements. The framework adapts the measurement strategy to application needs and manages application's queries (also referred to as user queries) by assigning hardware counters for disjoint sets of flow entries instead of individual flow entries. The lattice-based framework has been shown to generate the minimal number of hardware counters for answering user queries.

The FlowME traffic measurement framework enables fine-grain querying of the network traffic flows and extracting of the query-bound flow measurements. To that end, a hierarchy of high-level, flows-to-matchfields abstractions is constructed and used to support query answering. This hierarchy of abstractions is referred to as a lattice, a concept lattice, or a lattice structure. The approach relies on basic results from the lattice theory to elaborate the concept lattice, winch is used to factor out answer flowsets that are common to several queries. A further benefit of the lattice structure is to enable a better-informed process of counter assignment, under the assumption that all of the queries from a given set are provided with statistics while each flow increases at most one counter. The approach establishes a trade-off that provenly minimizes the storage space with respect to the number of counters. To that end, a sub-structure of the aforementioned lattice is identified that embodies a flows-to-queries mapping. Thus, the lattice-based framework can take advantage of indistinguishableness between flows, allowing for a reduction in the overall number of counters.

The framework further supports evolution in the concrete parameters of the overall traffic measurement. Evolution scenarios include changes in the collections of queries and/or flows, with or without extending the underlying set of matchfield expressions. The maintenance of both the flow-to-matchfield lattice and its flow-to-query substructure relies on the same lattice theory body of knowledge about lattice evolution upon changes in the input data. Once more, the mathematical foundations of the approach allow the maintenance overhead to be kept to a minimum.

The framework also adapts to conventional switch hardware resources and requires no additional infrastructure. The framework integrates with flow entries data structure and performs measurements simultaneously with traffic processing. The framework can be exploited in a wide range of router architectures including Openflow switches.

FIG. 1 illustrates an example of flow aggregation according to one embodiment of the invention. This example shows a flow-centered approach in which multiple flows are aggregated into a flow set, and each query corresponds to one or more flow sets. Flows in the same flow set can share the same hardware count Definitions of the terminology used herein are provided below.

-   -   A flow entry, denoted f is composed of a set of match fields         (equivalently, flow attributes) that defines the flow, a counter         and a set of instructions. When a packet matches f, instructions         are performed and counter associated to f is updated.     -   The set of installed flows in a specific switch is denoted         .     -   A match field is an attribute of a flow. The set of match field         values is denoted         .     -   A user query qεQ is a sequence of regular expressions on flow         match fields values. In our demonstration, a user query is         modelled by the attributes of traffic it selects. For example, a         query formulated as “how much FTP traffic is received from node         10.0.0.1?” is represented by q={h₁, h₂} where h₁=10.0.0.1 is a         field describing traffic from 10.0.0.1, and h₂=21 describes FTP         traffic. In the following, we use the set of queries Q={q₁, q₂,         q₃, q₄, q₅} where q₁={h₁₀}, q₂={h₂, h₆, h₈}, q₃={h₁}, q₄={h₁,         h₄, h₇} and q₅={h₇}.     -   A concept c is a pair of sets (F, H), where Fε         (         ) and Hε         (         ). The flowset F is called the extent and H the intent of the         concept. The notation         represents a powerset; the powerset of any set S is the set of         all subsets of S, including the empty set and S itself.     -   Hardware counters are memory or registers that are incremented         when a flow is matched. Each flow entry contains a reference to         a hardware counter.

The framework described herein provides exact statistics and more flexibility in traffic measurement while minimizing the number of needed hardware counters. One key element that enables reduction of the number of counters is factorization. Factorization involves hierarchically aggregating elements sharing the same attributes. For example, using flexible 5 match field rules, if user queries are focused on {DestIP and SrcIP} fields, the framework will reduce automatically the measurement space (typically 2¹⁰⁴ possible counters) by factorizing the processed flow entries sharing the same DestIP and SrcIP fields, and then assigning a counter to the specific aggregate that answers user queries. It has been proved that the use of a lattice is optimal for performing the proposed factorization. Further, the lattice can be constructed and updated quickly, allowing both real-time and exact statistics.

1 Theoretical Results Underlying the FlowME Framework

In the following, the theoretical results underlying the FlowME framework are described. The theory results are derived based on the formal concepts analysis (FCA). As FCA sprang off the lattice theory, it is helpful to recall some useful notions related to lattices and ordered structures in general.

The Basics of Ordered Structures

Given an arbitrary set G, the structure P=

G, ≦_(P)

is a partial order (poset) over G provided ≦_(P) ⊂G×G is a reflexive, antisymmetric and transitive binary relation. For any pair of members a, bεG, if b≦_(P) a means a is greater than or equal to b, whereas if neither b≦_(P) a nor a≦_(P) b holds, then a and b are incomparable. Assume G={g₀, g₁ . . . g₁₈} whereas ≦_(P)={(g₈, g₄), (g₂, g₈), . . . }. By reflexivity of ≦_(P), we can deduce that (g₈, g₈)ε≦_(P) whereas by transitivity on the first two pairs (g₂, g₄)ε≦_(P).

Furthermore, any cεG such that c≦_(P) a and c≦_(P) b is called lower bounds of a and b (upper bounds are dual). The precedence relation

_(P) in P is the transitive reduction of ≦_(P), i.e. a

_(P) b if a≦_(P) b and all c such that a≦_(P) c≦_(P) b satisfy c=a or c=b. Given such a pair, a will be referred to as an immediate child of b and b as an immediate parent of a, {hacek over (c)} and ĉ respectively. Usually, P is visually represented by its covering graph Cov(P)=(G,

_(P)). A drawing of the covering graph where edges are systematically going upwards hence their orientation is skipped is called the Hasse diagram of P. FIG. 2 illustrates an example of the Hasse diagram of the aforementioned 19 element-strong poset. Following the drawing, g₂

_(P) g₈, hence g₈ is the unique immediate successor of g₂. Moreover, g₈ is an upper bound for g₂ and g₉, while g₀ is a lower bound for g₂ and g₈ (as well as g₉).

A lattice L=

G,≦_(L)

is a poset where any pair of elements a, b admits a unique greatest lower bound (a

_(L)b) and a unique least upper bound (a

_(L)b).

_(L) and

_(L) represent binary operators on G called join and meet, respectively. In a complete lattice L, joins and meets generalize to arbitrary sets A⊂G, i.e.,

_(L)A and

_(L)A necessarily exist. In particular, there are unique maximal (top, T=

_(L)G=

_(L)Ø) and minimal (bottom, ⊥=

_(L)G=

_(L)Ø) elements in such a lattice. The poset illustrated in the example of FIG. 2 is a lattice and, as it is finite, it is automatically complete lattice as well. For instance, following the drawing, g₃

_(L)g₇=g₆, g₂

_(L)g₈=g₈ and g₂

_(L)g₆=g₃. Furthermore,

_(L){g₅, g₁₄, g₁₈}=g₁₁.

A structure with only one of the above operations is called semi-lattice, e.g., the existence of a unique meet for any couple (set) of elements implies a (complete) meet semi-lattice structure. Consequently, a (complete) lattice is the superposition of two (complete) semi-lattices, one for each of the operators.

Input Data in FCA

In FCA, data is represented as a set of individual observations with proper descriptors which are akin to unary predicates. It is introduced as an object-to-attribute cross-table, called a (formal) context. Formally speaking, a context

(O, A, I) associates a set of objects O to a set of attributes A through an incidence relation I⊂O×A. A pair of the incidence relation oIa is interpreted as indicating that the object o has the attribute a.

According to one embodiment of the invention, FCA can be applied to traffic measurement, in which objects are system flows f whereas flow attributes are match field expressions h. Consequently, the resulting context will be denoted

(

,

, M) where

is the universal flow set supported by the system and

the total set of match field expressions admitted by the system. Their incidence is expressed through the “match” relation M⊂

×

where a pair (f, h)εM means “the flow f satisfies the match field h”.

FIG. 3 illustrates an example of a context according to one embodiment of the invention. The context has two dimensions: a flow dimension and a flow attribute (match field) dimension. The context includes context entries marked by Xs in the cross-table of FIG. 3. This context will be used in the following description as a running example.

Formal Concepts and their Lattice

Using FCA, conceptual descriptions can be extracted from the context by factoring out description shared by individuals context elements. Generally speaking, the basic FCA method pinpoints all maximal sets of shared descriptors which, clearly, translate regularities in the distribution of those descriptors. Geometry-wise, these materialize as maximal rectangles of the cross-table that are made of Xs (not necessarily contiguous). These are naturally ordered with respect to set-theoretic inclusion, either on the object or the attribute dimensions. The resulting partially ordered set of descriptions represents a complete lattice.

Formally, the factoriztion is rooted in a pair of maps that lift the incidence relation to the set level. Thus, each set of flows maps to the set of shared match fields and vice versa. Due to their symmetric nature, both are denoted by ′ in FCA. Applying FCA to the context of the traffic measurement example of FIG. 3, the mapping is defined as follows:

Definition

The operator ′ a set of flows into a set of all common match fields, and a set of match fields into the set of all flows that satisfy them: ′:

(

)→

(

),F′={hε

|∀fεF,(f,h)εM}, ′:

(

)→

(

),H′={fε

|∀hεH,(f,h)εM}.

With respect to the running example in FIG. 3, {f₃, f₆}′={h₆, h₁₀} and {h₂, h₆}′={f₂, f₃}.

The compound operators | made by subsequently applying each of the above ′ operators map each powerset

(

) and

(

) into itself. Both knowingly represent closure operators which means, in particular, that X⊂X″ and (X″)″=X″ for any flow set (Xε

)) and any math field set (Xε

). Each of the ″ operators thus induces a family of closed subsets or closures, i.e., such that X=X″, which will be denoted here

⊂

(

) and

⊂

(

). For instance, {f₃, f₆} is not closed since it is strictly included in its closure {f₃, f₆}≠{h₆, h₁₀}′={f₃, f₆, f₇}; {f₃, f₆, f₇}={f₃, f₆, f₇}″ is obviously closed. It is easily seen that a closure operator induces an equivalence relation on the respective powerset: two sets are equivalent whenever they have the same closure (e.g., obviously {f₃, f₆}≡{f₃, f₆, f₇}).

Moreover, such a family of closures is itself closed by set-theoretic intersection ∩, i.e., the intersection of ally subset of closures is itself a closure. This regularity translates structurally: whenever the closure family provided with the set-theoretic inclusion ⊂, the resulting poset is a semi-lattice.

FCA focuses on a two-dimensional structure that superimposes both semi-lattices of a given context. To that end, the natural one-to-one correspondence is captured in the notion of formal concept.

Definition

A concept is a pair of sets (F, H) where Fε

(

), Hε

(

), F=H′ and H=F′. F is called the extent and H the intent of the concept.

For instance, in above context ({f₃, f₆, f₇}, {h₆, h₁₀}) is a concept, whereas ({f₃, f₆}, {h₆, h₁₀}) is not.

Furthermore, the set

of all concepts of a context

is partially ordered by intent/extent inclusion: (F ₁ ,H ₁)

(F ₂ ,H ₂)

F ₁ ⊂F ₂ ,H ₂ ⊂H ₁.

The partial order

,

actually forms a complete lattice, called the concept lattice (sometimes Galois lattice as well) whereby the lattice operators are given in the following property.

Theorem 1.1

=

,

is a complete lattice with join and meet defined as follows:

_(i=1) ^(k)(F _(i) ,H _(i))=((∪_(i=1) ^(k) F _(i))″,∩_(i=1) ^(k) H _(i)),

_(i=1) ^(k)(F _(i) ,H _(i))=(∩_(i=1) ^(k) F _(i),(∪_(i=1) ^(k) H _(i))″).

The above theorem indicates that intersection of intents/extents is necessarily an intent f extent whereas union might not be.

The Hasse diagram of the lattice

drawn from the running example of FIG. 3 is shown in FIG. 4, where concepts are identified by integer numbers whereas intents and extents are labels introduced by annotations I and E, respectively. For instance, the join and the meet of the concepts c₅ and c₁₃ are c₁₁ and c₇, respectively.

For the sake of instead of showing complete sets of intents and extents, FIG. 4 shows reduced intents and extents. Thus, the concept c₁₃ which at first sight might seem to be totally void, actually has non void intent and extent, c₁₃=({f₃, f₆, f₇}, {h₆, h₁₀}). In fact, reduced labelling uses a ground property of concept lattices stating that for each fε

(hε

), there is a unique minimal (maximal) concept c=(F, H) such that fεF (hεH).

Property 1.2

To each element of a context

(

,

, M) corresponds an external concept:

-   -   ∀fε         , the flow concept ({f}″, {f}′) is the minimal concept among all         those comprising     -   ∀hε         , the match field concept ({h}′, {h}″) is the maximal concept         among all those comprising h.

Following the above property, two auxiliary functions are defined.

Definition

The functions μ and ν map context elements into their respective external concepts as follows: μ:

→

with μ(f)=({f}″,{f}′), ν:

→

with ν(h)=({h}′,{h}″),

Back to Hasse diagrams and labeling, each f (h) can be explicitly drawn in the extent (intent) of μ(f) (ν(h)) while all other relevant concepts would “inherit” it from that concept upwards (downwards). Thus, the extent of c₇=({f₃}, {h₂, h₆, h₈, h₁₀}) is the Hon of the extents of c₅=({f₂, f₃}, {h₂, h₆, h₈}) and c₁₃=({f₃, f₆, f₇}, {h₆, h₁₀}).

In summary, concept lattices factor out all the shared descriptions among a collection of individuals and hence comprise all maximal groups of such individuals together with the shared descriptors. Furthermore, the Hasse diagram provides a hierarchical organization of all concepts which may be used both to speed-up their computation and for subsequent retrieval. This might prove particularly useful when the set of concepts is to be generated dynamically, i.e., upon changes in the context.

Computational and Complexity Issues

In the following, an algorithm (Algorithm 1) for lattice construction is described below. The algorithm builds the concepts and their relations based on flow entries. It constructs the lattice top-down, i.e., starting at the top concept and moving downwards. At each concept, it generates the set of its lower covers. To that end, it first produces the extents of a larger set of sub-concepts (yet not all of the sub-concepts) by intersection of the concept extent with the images of all matchfields that are not in the concept intent. It is easily shown that the lower covers are then the maxima of the resulting concept set.

The algorithm connects the concept to each of its lower covers and adds those to the queue of concepts waiting to be processed. For instance, at concept c₈=({f₀, f₁, f₄, f₅}, {h₁, h₇}) in the example of FIG. 4, the algorithm produces the following four extents: Ø (by separate intersections with (h′₂, h′₃, h′₆, and h′₈), {f₀, f₁} (with h′₄), {f₁, f₅} (with h′₅ and h′₀), and {f₀, f₄} (with h′₉). The last three of them are clearly maximal, hence they correspond to the lower covers of c₈ whose intents are exactly the intent of that concept augmented by the generating matchfields (c₂, c₁₀, and c₉, respectively).

Algorithm 1: Lattice construction algorithm

Maintaining Lattices Upon Context Evolution

According to one embodiment of the invention, the lattice can be incrementally updated in scenarios that include adding a new object (How) or, dually, a new attribute (match field).

Formally, it is assumed that a new flow, e.g., f_(n), completes the system whose context was previously

(

,

, M). The resulting context,

_(n)(

_(n),

_(n), M_(n)) is such that

_(n)=

∪{f_(n)},

_(n)=

and M_(n)=M∪{f_(n)}×f′_(n). In short, the flow set is extended by one new row in the cross-table but the part corresponding to the previously existing flows remains unchanged. For instance, assume that a new flow, f₈ with matchfields h₂, h₇ and h₉ is added to the context of our running example, as presented in FIG. 5.

Regarding the concept lattice of

_(n), e.g.,

, it may well be computed from scratch, yet a smarter approach derives it from the readily available structure

. Mathematically speaking,

is isomorphic to a suborder from

, i.e., all the concepts of the former poset “exist” in the latter (although not necessarily in exactly the same composition). This means that computation-wise, we only need to add to the data structure representing

a few new nodes (plus minor adjustments) to make that structure represent

. The result of such a restructuring operated on the lattice from FIG. 4 is visualized in FIG. 6. Notice that concept numbers work as identifiers: concepts with the same numbers in both figures have the same intents. To ease comprehension, only relevant concepts are provided with intents and extents (full extents and intents are provided).

The following describes an outline of the overall incrementing approach for incrementing lattice maintenance. The approach is based on the stable dimension of the context, the matchfield set

, and focuses on the closure family

. A basic fact is that all intents from

are also intents in

.

Property 1.3

Given

(

,

, M) and f_(n), in the corresponding extended context

_(n)(

_(n),

_(n), M_(n)) holds:

⊂

The incremental approach computes

from {f_(n)}′, the matchfield set of the new flow, and

instead from plain M_(n).

. The result is that new closure missing from

can be computed by pairwise intersection of {f_(n)}′ with members of the former set. Indeed, exploring the same observation on intents as above, an intent from the larger context is a row intersection involving either exclusively rows from the smaller context or a possibly empty subset of such rows plus the new row.

Property 1.4

Given

(

,

, M) and f_(n), in the corresponding extended context

_(n)(

_(n),

_(n), M_(n)) holds:

=

∪{{f _(n) }′∩H|Hε

}.

Correspondingly, the extents of concepts in

have only two possible forms: F or F∪{f_(n)} where F is a previous extent, i.e., Fε

. For instance, c₂₀ has an extent {f₀, f₄, f₈} which is exactly the extent of the previously existing concept c₉, augmented by the new flow f₈. In summary, a significant amount of work could be saved by avoiding the total regeneration of all previously existing intents from

.

Regarding the computation of the missing intents from

, it is noteworthy that intersections H of an intent H₀ from

and {f_(n)}′ can either represent a new closure, i.e., H was not closed in

but is now in

_(n), or correspond to an old closed set. In the first case, a new concept will have to be created with H as intent, whereas in the second, the already existing concept, with H as its intent, will have to be updated by adding f_(n) to the extent. For instance, in our running example, the concepts c₁₉ to c₂₂ (see FIG. 6) have been newly generated within the extended context whereas c₂₂ is the flow concept of the new flow f₈. Their respective intents are all the intersections of the matchfield set of f₈, i.e., f′₈={h₂, h₇, h₉}, with the intents from our initial context

. These are, {h₂}, {h₇, h₉}, {h₂}, and {h₂, h₇, h₉}, respectively. Except for these concepts, two other concepts, already in the initial lattice, now comprise f₈ in their respective extents: c₄ and c_(u), i.e., the modified concepts.

A major problem here arises from multiple generations: an intersection H may be obtained from several existing intents. For instance, the new intent {h₇, h₉} can be the intersection of f′₈ with either of the intents of c₀ and c₉ ({h₁, h₄, h₇, h₉} and {h₁, h₇ h₉}, respectively). Hence, the effective creation of the underlying concept c₂₀ need to be performed only once, with the right intent (concept) from

. Furthermore, the extents of the newly created concepts need to be computed as well. A key mathematical result states that all one needs to care about is the concept with the minimal intent H_(m), from

that generates a given intersection H (which is, therefore, maximal among all such concepts). The uniqueness of such H_(m) is rooted in the fact that it is the closure of H in

, i.e., H_(m)=H″. For instance, in our running example, the closure of the new intent {h₇, h₉} is {h₁, h₇, h₉} from the concept c₉. It is noted that this works even for H which are closed in

. For instance, the empty set is a valid intersection of the new intent with, e.g., {h₁₀} from concept c₆, yet the maximal concept for it is the top one, i.e. c₄.

As indicated in the introduction to this section, match field-wise increments of the lattice work dually, i.e., through the family of extents

. Moreover, removing a flow f match field amounts to factor out the structure by removing the concepts that have become obsolete and by dropping the removed element from the remaining concepts that still bear it.

2. The FlowME Framework

In this section, the FlowME framework is described in more detail based on the above-described theoretical analysis and results.

TABLE 1 Notations I_(c) Concept c Intent E_(c) Concept c Extent v(c) Concept c query vector Q Set of user queries g(c) Flows grounded in c |.| The cardinality of a set t(c) Queries targeted by c T Set of Target concepts P Set of Projection concepts G Set of Ground concepts Flow Concepts Generation

The input data to the FlowME framework includes flow entries and user queries. A query is a conjunction of matchfield descriptors. Queries share flows in their respective flow sets and that shared semantics can be reflected in counter assignment to flows. Initial data preparation for FlowME includes generating the complete lattice

of flow entries denoted

and their matchfield values denoted

.

Measurement Structure Generation

A main function of the FlowME framework is to produce groups of disjoint set of flow entries to be managed by one counter for each group instead of per-flow counter assignment. Given a concept

and a list of user queries Q, the flowset partition identification algorithm (Algorithm 2) passes through concept lattice to identify target concepts T, projection concepts P and ground concepts G. A concept (F, H)ε

is composed of a set of matchfield values H⊂

and a group of flows F⊂

that match with H. The algorithm sorts the concepts list C in decreasing order w.r.t. the number of flows to be sure of finding the largest groups with minimum effort. Based on queries and the concept lattice, the algorithm finds the set of ground concepts. Flow entries grounded to the same ground concept form the same partition and are then managed by the same counter.

Algorithm 2 is described in detail below. The query vector for a concept c, ν(c) is an N-bit string that indicates whether the query q_(i) is answered by the concept c intent I_(c):

${{\upsilon(c)}\lbrack i\rbrack} = \left\{ {{\begin{matrix} {1,} & {{{if}\mspace{14mu} q_{i}} \subseteq I_{c}} \\ {0,} & {otherwise} \end{matrix}1} \leqslant i \leqslant N} \right.$ Vector values are computed in Algorithm 2 (line 7) by performing a logical OR operation on the query vectors of the concept c initialized with possible target queries (line 5) and the vectors of its parents concepts.

A concept c is identified as a target concept when it is the first concept to match with a query qεQ. In order to generate the target concept list T, the algorithm maintains a list of user queries Q, and whenever a target concept is found, the corresponding query q is removed from the query list. Target counters identification ends when query list Q is emptied.

Projection concepts pεP represent arbitrary infimums of target concepts, hence their extents are intersections of target concept extents. In FIG. 4, c₁₀ is a projection since it is the infimum (i.e., greatest lower bound) of the target concepts c₈ and c₆. A concept is identified as a projection concept if no immediate superior projection concept has a richer set of queries. This can be verified rapidly in Algorithm 2 (line 8) by comparing the vector cardinality to the maximum query vector cardinality in ĉ (line 8). Indeed, the query vector of c₁₀ is of size three which is more than the respective vector sizes of its upper covers c₆ and c₈ (one and two, respectively). Finally, based on a flow concept c(F, H) where |F|=1, a projection concept is considered ground concept if it has the same set of queries 12).

For a specific context of flow entries set

and user queries Q, the underlying hardware infrastructure maintains counters for groups of flows defined by the ground concept's intents: F _(g) ={F ⊂

∃(F,H)εG _(Q)}

One hardware counter is assigned per group of flow entries. The number of counters is then N=|F_(g)|. Note that since the groups are disjoint and no flow entry participate in more than one group, N≦|

| in worst case, the number of counters to maintain is equal to the number of flow. Flow entries f₆ and f₇ participate to the ground concept c₆ and then forms a partition of two flow entries. Flows f₀, f₁, f₂, f₃, f₄ and f₅ participate in independent ground concepts and then each of them forms a partitions of one flow entry.

Query Concepts and their Semi-Lattice

The above framework can be enhanced with a new aspect pertaining to queries. We assume a list of potential user queries, e.g., Q, and examine the way they relate to the concepts from

. As a simplifying hypothesis, we posit the complete compliance of Q to the descriptive language induced by the context, i.e., Q⊂

(

). In other words, each user query q is made exclusively of match fields that belong to

.

Similar to single match fields from

, each q may be mapped to a unique concept of the lattice, called hereafter its target concept, that is identified by the closure q″:

Definition

Given a query q⊂

, its target concept within the context

(

,

, M) is defined as follows: γ:

(

)→

with γ(q)=({q}′,{q}″)

Algorithm 2: Flowset partition identification algorithm

By its very definition, the target concept of a query q satisfies the following properties: (i) its intent is the closure of q within the context

, and (ii) its extent is the answer flow set of q. For instance, with the sample set of queries and the lattice in FIG. 4, γ(q₂)=c₅, γ(q₃)=c₈, and γ(q₅)=c₈. The three answer sets are respectively {f₂, f₃} and {f₀, f₁, f₄, f₅} (twice).

A corollary of the above properties is that whatever the query q⊂

is, its answer flow set necessarily appears in the lattice.

Corollary 2.1

The concept lattice comprises all potential answer flow sets for queries from

.

Thus, storing the entire lattice can help answer the queries in a more efficient manner (provided a low-cost target concept lookup mechanism is designed). Moreover, due to the factorization within the concept lattice, queries from the same closure-induced equivalence class will share the target concept and hence the answer set (e.g., see q₃ and q₅ above). It is noteworthy, that this also holds for queries that are not in the initial set Q, but could be introduced at a later step. Thus, such new queries, provided they remain within

, do not generate any computational overhead on the concept set.

From a more statistics-oriented standpoint, concepts may be considered as the basis for packet counter assignments. Assuming that each flow increments at most one counter, a natural goal would be to assess the minimal number of counters required in the answers of all queries from Q. To formally ground our reasoning, we first establish a support structure for Q within the concept lattice. Its basis is the set of all target concepts from

which will be denoted, through a notation overload, as γ(Q).

Definition

Given a query set Q⊂

(

), its target concept set within the context

(

,

, M) is defined as follows: γ(Q)={γ(q)|qεQ},

In the running example, γ(Q) {c₂, c₅, c₆, c₈}. Clearly, a rough approximation of our final solution would be to assign a counter to each concept from γ(Q). Such a solution would have the advantage of providing the statistics with no computational overhead. Yet this means that whenever a flow belongs to the extents of at least two target concepts (e.g., f₅ is in both c₆ and c₈), it should contribute to as many counters (hence incur some processing overhead), which is a breach of the above single-counter constraint. Hence a more purposeful solution would require managing the intersections of target concept extents so that each flow is assigned a unique smallest subset whose counter it should increment. Query statistics can then be computed by summing up the counters corresponding to the relevant subsets of its extent flowset.

The above reasoning leads us to a definition of a family of As that represent the answer sets of queries from Q and (at least some) intersection thereof. A first result about the underlying structure is that it must comprise all intersections of target concept extents. Indeed, it is easily seen that the above reasoning could be inductively applied to first-order intersections, then to second-order ones, so forth, until all possible intersections are proven to require consideration for counter assignment. Following the definition of the concept lattice, all these intersections correspond to concepts from

(they correspond to all arbitrary meets of concepts from γ(Q)). Hence, a new lattice sub-structure is defined which is induced by γ(Q) through arbitrary meets:

Definition

Given a query set Q⊂

(

), its projection concept set within the context

(

,

, M) is defined as follows: γ(Q)

={

X|X ⊂γ(Q);X≠Ø},

The projection set of our sample queries is γ(Q)

={c₁, c₂, c₃, c₅, c₆, c₇, c₈, c₁₀}. Moreover, the projection set of a query set Q forms a meet semi-lattice with respect to the order in the concept lattice, since its respective family of extents is closed by intersection. Therefore, the resulting substructure is called

=γ(Q)

,

) the projection semi-lattice.

Next, consider the mapping of flows to projection concepts. A basic observation shows that for a flow f that belongs to at least one projection concept, there is always a unique minimal such concept in γ(Q)

.

Property 2.2

Given a flow f from the context

(

,

, M) and a query set Q⊂

(

) where at least one q covers f the concept

{(F, H)|(F, H)εγ(Q)

; fεF} is the minimal projection concept comprising f.

An auxiliary function is defined that maps each flow f to the minimal projection concept comprising it. For completeness, if no projection concept has f, it is mapped to the lattice top.

Definition

The functions μ_(|Q):

(Q)

∪{T} maps a flow f into the its ground concept: μ_(|Q)(f)=

{(F,H)|(F,H)ε

_(|Q) ;fεF}.

The values of μ_(|Q) for the running example are as follows: (f ₀ ,c ₂);(f ₁ ,c ₃);(f ₂ ,c ₅);(f ₃ ,c ₇);(f ₄ ,c ₈);(f ₅ ,c ₁₀);(f ₆ ,c ₆);(f ₇ ,c ₆).

The minimal projection concept of a flow f is a canonical representative for the set of all concepts from γ(Q)

that comprise f.

Property 2.3

Given two flows f₁, f₂ε

the following equivalence holds: μ_(|Q)(f ₁)=μ_(|Q)(f ₂)iff{(F,H)|(F,H)ε

_(|Q) F}={(F,H)|(F,H)ε

_(|Q) ;f ₂ εF}.

It is noted that for a given f, the set {(F, H)|(F, H)ε

_(|Q); fεF} is exactly the set {c|cεγ(Q)

; μ_(|Q)(f)

c}, i.e., the set of all projection concepts greater or equal to the minimal one for f.

In a way similar to the definition of the target concept set for queries, we define the set of all minimal projection concepts for flows, called ground projections.

Definition

Given a query set Q⊂

(

), its ground projection concept set within the context

(

,

, M) is defined as follows: μ_(|Q)(

)={μ_(|Q)(f)|fε

}−T,

In the running example, the above set covers the projection semi-lattice almost completely: μ_(|Q)(

)={c₂, c₃, c₅, c₆, c₇, c₈, c₁₀}. Yet in a more realistic settings, only a fraction thereof will be made of ground projections.

Counter Assignment and Minimality Results

The FlowME framework provides a counter assigning principle for

based on γ(Q)

. The ground projections in μ_(|Q)(

) are the only concepts assigned a counter each while ignoring the remaining members of

. This explains why the top concept had to be excluded. Now, with this counter assignment, a particular flow f is to be “wired” to the counter of its μ_(|Q)(f) (whenever different from T). Thus it only reports to a single statistics. Moreover, the exact statistics of each projection concept c, inclusive the target ones in γ(Q), are obtained by summing up the values of all the counters corresponding to sub-concepts and then adding its own counter, if c is itself a ground projection.

Property 2.4

The set of counters corresponding to the concepts in μ_(|Q)(

) is the minimal one that ensures the exact answer of all the queries in Q.

We have proved this property by reduction ad absurdum. We have shown that there is no smaller set of counters that can correctly answer all queries from a given set Q. The proof is not described herein.

Evolving the Query and Flow Sets

In practice, the environment represented by the concepts is dynamic and subjects to frequent changes. Realistic change scenarios include launching previously unseen queries, adding/removing flows, inserting additional match fields, e.g., following the launch of a new query, etc.

The FlowME framework performs incremental updates to a lattice structure upon a change to a flow entry while minimizing the corresponding lattice restructuring efforts. An example lattice structure updating algorithm for adding a flow entry (Algorithm 3) is provided herein. Lattice update algorithms for other scenarios, such as deleting a flow entry, can be similarly devised. The algorithm restructures the projection semi-lattice, as the semi-lattice of extents corresponds to projection concepts. The algorithm updates the concept lattice when a new flow entry is added to the context. In the following, a new flow entry f₈ with matchfields {h₂, h₇, h₉} is added to the initial context (FIG. 5). A basic property is that the new concept lattice should contain all intersections of the new flow matchfields denoted {f_(n)}′ with old concepts intents. First, if a concept c contains already the intersection H, then f_(n), is added to c extents (line 5). That is the case of concept c₁₂

Algorithm 3: Lattice update: Add a flow

where H_(c) ₁₂ ∩{f₈}′=H_(c) ₁₂ , thus, concept c₁₂ is updated in the new context by adding f₈ to its extents. Second, if H is not present in the old lattice, the algorithm uses the actual concept c to generate a new concept c_(n) with the H as intent and f_(n) and E_(c) as extents (line 7). Concept c is called the genitor of c_(n). In the running example as shown in FIG. 6, the genitors of concepts c₁₉, c₂₀, c₂₁, c₂₂ are c₈, c₉, c₅ and c₁, respectively.

In the running example of FIG. 6, the concepts c₁₉ to c₂₂ have been newly generated within the extended context whereas c₂₂ is the flow concept of the new flow f₈. Their respective intents are all the intersections of the matchfield set of f₈, i.e., f′₈={h₂, h₇, h₉}, with the intents from the initial context

. These are, {h₇}, {h₇, h₉}, {h₂}, and {h₂, h₇, h₉}, respectively. Next, the algorithm positions the new concept c₇, in its genitor c parent's set and positions the genitor c as child of c_(n) (line 8). The result of such a restructuring operated on the lattice from FIG. 4 is visualized in FIG. 6. It should be noted that concept hers work as identifiers: concepts with the same numbers in both figures have the same intents. To ease comprehension, only relevant concepts are provided with intents and extents (full extents and intents are provided). Finally, the ground concept of the new flow f_(a) is the projection concept c_(p)εP that have the same query vector as the flow concept μ(f_(n)) (line 11). In our example, ν(μ(f₈))=ν(c₂₂)=00001 is the same as the projection c₁₉ query vector. The new flow f₈ is grounded to c₁₉ (line 13).

Algorithm 4: UpdateStatus: Update support structure

The UpdateStatus procedure, presented in Algorithm 4, is called whenever a new concept is added to the lattice to update its status i.e., target, projection, or ground, and the status of its genitor. In our example, the newly created concept c₁₉ answers q₅={h₇}, thus, q₅ will be targeted to c₁₉ and removed from its genitor c₈ targeted queries set (line 3). Projection concepts are identified analogically to Algorithm 2. Next, the genitor of the new concept c_(n), is no longer considered as projection if it has the same number of queries as c_(n). Finally, if there is a flow grounded to the new concept, then the algorithm moves all grounded flows of the genitor to the new concept. As a result of the restructuring in the extended lattice example, the modified concepts are c₄ and c₁₂. The new target concept list is T⁺=T∪{c₁₉}. The new projection concept list is P⁺=P∪{c₁₉}. The new ground concept list is G⁺=G∪{c₁₉}.

FIG. 7 is a block diagram illustrating a computing device 700 for performing the operation of the FlowME framework according to one embodiment. The computing device 700 assigns hardware counters to flows passing through a switch 740 for performing measurement at the switch 740. In one embodiment, the computing device 700 may be part of the switch 740; in alternative embodiments, the computing device 700 may be part of a server computer coupled to the switch 740, or part of a controller coupled to the switch 740 in a split structure network).

In one embodiment, the switch 740 includes a flow table memory 750 that stores flow entries, and hardware counters 760 for measuring network traffic. In one embodiment, the hardware counters 760 may be implemented by registers or random access memory (RAM), such as dynamic random access memory (DRAM), static random access memory (SRAM), or other types of RAM. It is understood that the switch 740 includes other components that are not described herein.

In one embodiment, the computing device 700 includes input circuitry 710 to receive flow entries and a set of user queries, each user query specifying a set of the flow attributes to be measured. The computing device 700 also includes a processor 720 coupled to the input circuitry 710. In one embodiment, the processor 720 includes a concept generator module 711 adapted to construct a lattice of interconnected concepts based on the flow entries, where each concept describes a subset of the flows and a subset of the flow attributes. The processor 720 also includes a flowset builder module 712 adapted to identify disjoint flowsets from the lattice based on the set of user queries. At least one of the flowsets includes more than one flow to thereby enable sharing of the hardware counters among the flows belonging to the same flowset. The processor 720 also includes a counter placement module 713 adapted to assign one hardware counter to each flowset. The computing device 700 also includes output circuitry 730 coupled to the processor 720 to output a mapping between flow identifiers and hardware counter identifiers to the switch 740 for assignment of the hardware counters 760.

In one embodiment, the computing device 700 also includes a statistics management module 714 that collects the traffic measurements made by the hardware counters 760 of the switch 740, and generates answers to the user queries. In alternative embodiments, the statistics management module 714 may be located within the switch 740 or other network nodes coupled to the switch 740 (a controller, a server computer, etc.). It is understood that the computing device 700 includes other components that are not described herein.

FIG. 8 illustrates one embodiment of a method 800 for assigning hardware counters. In one embodiment, the method 800 may be performed by a computing device, such as the computing device 700 of FIG. 7.

In one embodiment, a lattice of interconnected concepts is constructed by a processor (of a computing device) based on flow entries, which are received by the processor and available at the switch (block 810). Each concept describes a subset of the flows and a subset of the flow attributes. The processor also receives a set of user queries (block 820), each user query specifying a set of the flow attributes to be measured. Based on the set of user queries, the processor identifies disjoint flowsets from the lattice (block 830). Each flowset includes one or more of the flows to enable sharing of the hardware counters among the flows. The processor then assigns one hardware counter to each flowset (block 840).

FIG. 9 illustrates one embodiment of a method 900 for building flowsets. In one embodiment, the method 800 may be performed by a computing device, such as the computing device 700 of FIG. 7.

In one embodiment, a processor (of a computing device) identifies a set of target concepts in the lattice (block 910). Each target concept describes one or more flow attributes that match the set of the flow attributes specified by one of the user queries. The processor also identifies projection concepts in the lattice (block 920). The projection concepts include maximum intersections of the target concepts in the lattice. The processor then maps flows (described in the flow entries) to a semi-lattice defined by the projection concepts (block 930), and identifies ground concepts based on the mapping (block 940), where each ground concept defines a subset of the flows that form one of the flowsets.

The operations of the diagrams of FIGS. 8 and 9 have been described with reference to the exemplary embodiment of FIG. 7. However, it should be understood that the operations of the diagrams of FIGS. 8 and 9 can be performed by embodiments of the invention other than those discussed with reference to FIG. 7, and the embodiment discussed with reference to FIG. 7 can perform operations different than those discussed with reference to the diagrams of FIGS. 8 and 9. While the diagrams of FIGS. 8 and 9 show a particular order of operations performed by certain embodiments of the invention, it should be understood that such order is exemplary (e.g., alternative embodiments may perform the operations in a different order, combine certain operations, overlap certain operations, etc.).

Different embodiments of the invention may be implemented using different combinations of software, firmware, and/or hardware. Thus, the techniques shown in the figures can be implemented using code and data stored and executed on one or more electronic devices (e.g., an end station, a network node). Such electronic devices store and transmit (internally and/or with other electronic devices over a network) code (composed of software instructions) and data using computer-readable media, such as non-transitory tangible computer-readable media (e.g., computer-readable storage media such as magnetic disks; optical disks; read only memory; flash memory devices) and transitory computer-readable transmission media (e.g., electrical, optical, acoustical or other form of propagated signals such as carrier waves, infrared signals). In addition, such electronic devices typically include a set of one or more processors coupled to one or more other components, such as one or more non-transitory machine-readable media (to store code and/or data), user input/output devices (e.g., a keyboard, a touchscreen, and/or a display), and network connections (to transmit code and/or data using propagating signals). The coupling of the set of processors and other components is typically through one or more busses and bridges termed as controllers). Thus, a non-transitory computer-readable medium of a given electronic device typically stores instructions for execution on one or more processors of that electronic device. One or more parts of an embodiment of the invention may be implemented using different combinations of software, firmware, and/or hardware.

As used herein, a network node (e.g., a router, switch, bridge, controller) is a piece of networking equipment, including hardware and software, that communicatively interconnects other equipment on the network (e.g., other network nodes, end stations). Some network nodes are multiple services network nodes that provide support for multiple networking functions (e.g., routing, bridging, switching, Layer 2 aggregation, session border control, Quality of Service, and/or subscriber management), and/or provide support for multiple application services (e.g., data, voice, and video).

While the invention has been described in terms of several embodiments, those skilled in the art will recognize that the invention is not limited to the embodiments described, can be practiced with modification and alteration within the spirit and scope of the appended claims. The description is thus to be regarded as illustrative instead of limiting. 

What is claimed is:
 1. A method of assigning hardware counters to flows that pass through a switch in a communication network for performing traffic measurement at the switch, wherein each of the flows is associated with a set of flow attributes, the method comprising the steps of: constructing, by a processor, a lattice of interconnected concepts from flow entries available at the switch, each concept describing a subset of the flows and a subset of the flow attributes; receiving by the processor a set of user queries, each user query specifying one or more of the flow attributes to be measured; identifying disjoint flowsets from the lattice based on the user queries, each flowset comprising one or more of the flows to enable sharing of the hardware counters among the flows; and assigning one hardware counter to each flowset.
 2. The method of claim 1, wherein the step of identifying disjoint flowsets further comprises the steps of: identifying target concepts in the lattice, each target concept describing one or more flow attributes that match the flow attributes specified by one of the user queries; and identifying projection concepts in the lattice, the projection concepts comprising intersections of the target concept extents in the lattice.
 3. The method of claim 2, further comprising the steps of: mapping the flows to a semi-lattice defined by the projection concepts; and identifying ground concepts based on the mapping, each ground concept defining a group of the flows that form one of the flowsets.
 4. The method of claim 1, wherein the assigned hardware counters are a minimum set of counters for answering the user queries.
 5. The method of claim 1, further comprising the step of incrementally updating the lattice and the disjoint flowsets in response to an update to the flow entries.
 6. The method of claim 5, wherein the update to the flow entries includes adding or deleting a flow, or adding or deleting a flow attribute.
 7. The method of claim 1, wherein the hardware counters are programmable for measuring traffic of any one of the flowsets.
 8. The method of claim 1, wherein constructing a lattice further comprises the steps of: forming a two-dimensional context from the flow entries, the context having a flow dimension and a flow attribute dimension and a plurality of context entries, each context entry indicating one of the flows and corresponding flow attributes; and mapping the context to the lattice.
 9. The method of claim 1, further comprising the steps of: receiving by the processor measurements generated by the hardware counters from the switch; and providing answers to the user queries based on the measurements.
 10. A computing device in a communication network, the computing device to assign hardware counters to flows that pass through a switch for performing traffic measurement at the switch, wherein each of the flows is associated with a set of flow attributes, the computing device comprising: input circuitry to receive flow entries available at the switch and a set of user queries, each user query specifying one or more of the flow attributes to be measured; a processor coupled to the input circuitry, the processor comprising: a concept generator module adapted to construct a lattice of interconnected concepts from the flow entries, each concept describing a subset of the flows and a subset of the flow attributes, a flowset builder module adapted to identify disjoint flowsets from the lattice based on the user queries, wherein each flowset comprises one or more of the flows to enable sharing of the hardware counters among the flows, and a counter placement module adapted to assign one hardware counter to each flow, and output circuitry coupled to the processor to output a mapping between flow identifiers and hardware counter identifiers to the switch for assignment of the hardware counters.
 11. The computing device of claim 10, wherein the flowset builder module is further adapted to identify target concepts in the lattice, each target concept describing one or more flow attributes that match the flow attributes specified by one of the user queries, and to identify projection concepts in the lattice, the projection concepts comprising maximum intersections of the target concepts in the lattice.
 12. The computing device of claim 11, wherein the flowset builder module is further adapted to map the flows to the semi-lattice defined by the projection concepts, and to identify ground concepts based on the mapping, each ground concept defining a group of the flows that form one of the flowsets.
 13. The computing device of claim 10, wherein the assigned hardware counters are a minimum set of counters for answering the user queries.
 14. The computing device of claim 10, wherein the processor is further adapted to incrementally update the lattice and the disjoint flowsets in response to an update to the flow entries.
 15. The computing device of claim 14, wherein the update to the flow entries includes adding or deleting a flow, or adding or deleting a flow attribute.
 16. The computing device of claim 10, wherein the hardware counters are programmable for measuring traffic of any one of the flowsets.
 17. The computing device of claim 10, wherein the flowset builder module is further adapted to form a two-dimensional context from the flow entries, the context having a flow dimension and a flow attribute dimension and a plurality of context entries, each context entry indicating one of the flows and corresponding flow attribute, and to map the context to the lattice.
 18. The computing device of claim 10, wherein the processor further comprises a statistics management module adapted to receive measurements generated by the hardware counters from the switch, and to provide answers to the user queries based on the measurements. 